import caculate.mytime as mm

class NewInt(int):
    def __radd__(self, other):
        return int.__sub__(other,self)
a = NewInt(5)
b = NewInt(3)
print(a+b)   # 8 ,a默认有add方法，所以不会执行radd方法
print(1+b)  # -2  ， 1 没有add方法，所以执行b的radd方法，1-3=-2

t1 = mm.MyTimer()
print(t1.start())
print(t1)
print(t1.stop())
print(t1)

t2 = mm.MyTimer()
print(t2.start())
print(t2.stop())
print(t2)
print(t1+t2)